package models

import (
	"github.com/smash-llj/Nexa-server/global"
	"gorm.io/plugin/soft_delete"
)

type Session struct {
	global.BaseModal
	UserId      int                   `json:"userId" gorm:"comment:session所属用户id"`
	ToId        int                   `json:"toId" gorm:"comment:会话对象Id"`
	SessionId   string                `json:"sessionId" gorm:"comment:会话ID"`
	LastMsg     string                `json:"lastMsg" gorm:"comment:最后一条消息"`
	Unread      int                   `json:"unread" gorm:"comment:未读消息数量"`
	ChatType    int                   `json:"chatType" gorm:"comment:聊天类型 default:1 comment:2-好友 2-群聊"`
	SessionType int                   `json:"sessionType" gorm:"comment:session消息类别"`
	IsDel       soft_delete.DeletedAt `gorm:"softDelete:flag,DeletedAtField:DeletedAt"`
	IsPinned    int                   `json:"isPinned" gorm:"not null;default:0;comment:1-置顶 0-没有置顶"`
}
